﻿using blackhouse.BlackApart.Business.Furnitures;
using blackhouse.WebNemo.Business.Groups;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using blackhouse.WebNemo.Web;

namespace blackhouse.BlackApart.WebNemo {
    public class NemoFurniture : GroupRecord, IFurniture {

        #region Properties

        public int Id {
            get { return this.RecordId; }
        }

        public string Name {
            get {
                return this.GetString("nazwa");
            }
            set {
                this.SetValue("nazwa", value);
            }
        }

        public string Description {
            get {
                return this.GetString("opis");
            }
            set {
                this.SetValue("opis", value);
            }
        }

        public string ImageName {
            get {
                return this.GetFileName("ikona");
            }
            set {
                throw new NotImplementedException();
            }
        }

        public int Sort {
            get {
                return this.GetInt32("sortowanie");
            }
            set {
                this.SetValue("sortowanie", value);
            }
        }

        #endregion

        #region Constructors

        public NemoFurniture() : base("WYPOSAZENIE", 0) { }
        public NemoFurniture(int furnitureId) : base("WYPOSAZENIE", furnitureId) { }
        public NemoFurniture(IGroup group, IGroupRecord record) : base(group, record) { }

        #endregion

        public bool SaveFurniture() {
            base.Save();
            return true;
        }

        public bool AddToApartment(int apartmentId) {
            throw new NotImplementedException();
        }

        public void SetImageData(byte[] data) {
            throw new NotImplementedException();
        }

        public IFurniture[] GetApartmentFurnitures(int apartmentId) {
            throw new NotImplementedException();
        }

        public IFurniture[] GetApartmentTypeFurnitures(int apartmentTypeId) {
            throw new NotImplementedException();
        }

        public string GetFurnitureIconImageUrl(Size size) {
            if (this.IsNotNull("ikona"))
                return this.GetImageUrl("ikona", size);
            else
                return String.Empty;
        }

    }
}
